package com.ccx.coachsite.ui.tutorial;

import android.content.Context;
import android.view.View;

import com.ccx.coachsite.R;
import com.ccx.coachsite.ui.CommonAppView;
import com.ccx.coachsite.ui.customview.LazyViewPager;
import com.ccx.coachsite.ui.customview.ViewPagerTab;

public class TutorialMainView extends CommonAppView {

	public static final String TAG = "TutorialMainView";

	public LazyViewPager vp;
	public ViewPagerTab tab;

	private CommonAppView tutorialView;

	public TutorialMainView(Context context) {
		super(context);

		addView(R.layout.tutorial_viewpager);

		vp = (LazyViewPager) findViewById(R.id.pager);
		vp.addView(createTutorialView());

		tab = (ViewPagerTab) findViewById(R.id.pagertab);
		tab.addTitle(new String[] { context.getResources().getString(
				R.string.tutorial_topic,
				context.getResources()
						.getString(R.string.tutorial_phones_topic)) });
		tab.setViewpager(vp);
		vp.setTab(tab);
	}

	private View createTutorialView() {
		if (tutorialView != null)
			return tutorialView;
		tutorialView = new TutorialList(this.getContext());
		return tutorialView;
	}
}
